package db

import "gopkg.in/mgo.v2/bson"

//ref: https://www.cnblogs.com/spnt/p/4686128.html

type Model interface {
	TableName() string
}

//////////////////
type ManhuaHanmanBooks struct {
	Id            bson.ObjectId `bson:"_id"`
	ComicCoverImg string        `json:"comic_cover_img" bson:"comic_cover_img"`
	ComicID       string        `json:"comic_id" bson:"comic_id"`
	ComicTitle    string        `json:"comic_title" bson:"comic_title"`
	ComicDesc     string        `json:"comic_desc" bson:"comic_desc"`
	ComicLocal    string        `json:"comic_local" bson:"comic_local"`
	ComicSource   string        `json:"comic_source" bson:"comic_source"`
	ComicStatus   string        `json:"comic_status" bson:"comic_status"`
	ComicTags     string        `json:"comic_tags" bson:"comic_tags"`
}

func (ManhuaHanmanBooks) TableName() string {
	return "ManhuaHanmanBooks"
}

type Photo struct {
	PicOrder int    `json:"pic_order" bson:"pic_order"`
	Url      string `json:"url" bson:"url"`
}

type ManhuaHanmanChapter struct {
	Id            bson.ObjectId `bson:"_id"`
	ChapterID     string        `json:"chapter_id" bson:"chapter_id"`
	ChapterSource string        `json:"chapter_source" bson:"chapter_source"`
	ChapterTitle  string        `json:"chapter_title" bson:"chapter_title"`
	ComicID       string        `json:"comic_id" bson:"comic_id"`
	Photos        []Photo       `json:"photos" bson:"photos"`
}

func (ManhuaHanmanChapter) TableName() string {
	return "ManhuaHanmanChapter"
}

type ManhuataiComicList struct {
	Id                      bson.ObjectId `bson:"_id"`
	PinYinName              string        `json:"PinYin_name" bson:"PinYin_name"`
	CartoonAreaName         string        `json:"cartoon_area_name" bson:"cartoon_area_name"`
	CartoonAreaTag          string        `json:"cartoon_area_tag" bson:"cartoon_area_tag"`
	CartoonAuthorListName   string        `json:"cartoon_author_list_name" bson:"cartoon_author_list_name"`
	CartoonNewid            string        `json:"cartoon_newid" bson:"cartoon_newid"`
	CartoonStatusId         int           `json:"cartoon_status_id" bson:"cartoon_status_id"`
	CartoonTypeListName     string        `json:"cartoon_type_list_name" bson:"cartoon_type_list_name"`
	ComicFeature            string        `json:"comic_feature" bson:"comic_feature"`
	ComicId                 int           `json:"comic_id" bson:"comic_id"`
	ComicName               string        `json:"comic_name" bson:"comic_name"`
	ComicNewid              string        `json:"comic_newid" bson:"comic_newid"`
	ComicStatus             int           `json:"comic_status" bson:"comic_status"`
	Dashang                 string        `json:"dashang" bson:"dashang"`
	LastChapterNewid        string        `json:"last_chapter_newid" bson:"last_chapter_newid"`
	LatestCartoonTopic_id   string        `json:"latest_cartoon_topic_id" bson:"latest_cartoon_topic_id"`
	LatestCartoonTopic_name string        `json:"latest_cartoon_topic_name" bson:"latest_cartoon_topic_name"`
	Magazine                string        `json:"magazine" bson:"magazine"`
	Renqi                   string        `json:"renqi" bson:"renqi"`
	Score                   string        `json:"score" bson:"score"`
	UpdateTime              int           `json:"update_time" bson:"update_time"`
}

func (ManhuataiComicList) TableName() string {
	return "ManhuataiComicList"
}

type ManhuataiItem struct {
	ComicId      int                `json:"comic_id" bson:"comic_id"`
	ComicName    string             `json:"comic_name" bson:"comic_name"`
	ComicDesc    string             `json:"comic_desc" bson:"comic_desc"`
	ComicMedia   string             `json:"comic_media" bson:"comic_media"`
	ComicChapter []ManhuataiChapter `json:"comic_chapter" bson:"comic_chapter"`
}

func (ManhuataiItem) TableName() string {
	return "ManhuataiItem"
}

type ManhuataiChapter struct {
	ComicName string `json:"chapter_name" bson:"chapter_name"`
	ChapterId string `json:"chapter_id" bson:"chapter_id"`
	StartNum  int    `json:"start_num" bson:"start_num"`
	EndNum    int    `json:"end_num" bson:"end_num"`
	Rule      string `json:"rule" bson:"rule"`
}
